package com.jeesite.modules.codingrule.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author mnd
 */
public enum CodingLineTypeEnum {

	/**
	 * 枚举类型列表
	 */
	inputType("1", "手工输入", ""),
	serialNumberType("2", "流水号", "流水号"),
	yearType("3", "4位年", "yyyy"),
	year2Type("4", "2位年", "yy"),
	monthType("5", "2位月", "MM"),
	dateType("6", "2位日", "dd");

	private static final Map<String, CodingLineTypeEnum> CODING_D_TYPE_ENUM_MAP = new HashMap<>();

	static {
		for (CodingLineTypeEnum codingDTypeEnum : CodingLineTypeEnum.values()) {
			CODING_D_TYPE_ENUM_MAP.put(codingDTypeEnum.value, codingDTypeEnum);
		}
	}

	private final String text;
	private final String value;
	private final String desc;

	CodingLineTypeEnum(String value, String text, String desc) {
		this.value = value;
		this.text = text;
		this.desc = desc;
	}

	public static CodingLineTypeEnum toEnum(String value) {
		return CODING_D_TYPE_ENUM_MAP.get(value);
	}

	public String getText() {
		return text;
	}

	public String getValue() {
		return value;
	}

	public String getDesc() {
		return desc;
	}

	@Override
	public String toString() {
		return "CodingLineTypeEnum{" +
				"text='" + text + '\'' +
				", value='" + value + '\'' +
				", desc='" + desc + '\'' +
				'}';
	}

}

